<?php
namespace App\Http\Controllers\WebApi\Home;

use App\Repositories\Admin\OrderBaleRepository;
use Illuminate\Http\Request;

class BaleController extends BaseController
{
    protected $bale; //货单

    public function __construct()
    {
        parent::__construct();
        $this->bale = new OrderBaleRepository();
    }

    /**
     * 搜索条件
     */
    public function getConditions(Request $request)
    {
        return $this->toJson(0,$this->bale->getWebConditions());
    }

    /**
     * 列表
     */
    public function getIndex(Request $request)
    {
        $numId = $request->post('numId',1);
        $periodId = $request->post('periodId',1);
        $moneyId = $request->post('moneyId',1);
        $page = $request->post('page',1);
        $dataArr = $this->bale->getWebBaleList($numId,$periodId,$moneyId,$page);
        if (!$dataArr) { return $this->toJson(-3); }
        return $this->toJson(0,$dataArr);
    }

    /**
     * 详情
     */
    public function getOne(Request $request)
    {
    }
}